package com;

import Untils.JDBCUntils;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

public class Test10 {
    public static void main(String[] args) {
        Connection conn=null;
        PreparedStatement ps=null;

        try {
           conn = JDBCUntils.getconnection();
           String sql="update worker  set  banlance=banlance+? where id=? ";
            ps = conn.prepareStatement(sql);
            ps.setDouble(1,-500);
            ps.setInt(2,1);
            ps.executeUpdate();
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
}
